#include<stdio.h>
#include<iostream>
using namespace std;
void sort(int *p)
{
	int *first, *last,temp;;
	first = p;
	last = p+9;
	while (first != p + 9)
	{
		while (first != last)
		{
			if (*first > *last)
			{
				temp = *last;
				*last = *first;
				*first = temp;
			}
			last--;
		}
		last = p + 9;
		first++;
	}
}
int main()
{
	int a[10] = { 1, 0, 4, 8, 12, 65, -76, 100, -45, 123 };
	sort(a);
	for (int i = 0; i < 10; i++)
	{
		cout << a[i]<<" ";
	}
	return 0;
}